﻿Imports System.ComponentModel

Public MustInherit Class ClaseBaseMethod

#Region "Insertar,Actualizar,Eliminar"
    Public MustOverride Function Insertar(ByVal _Obj As ClaseDosCamposObj) As ClaseDosCamposObj

    Public MustOverride Sub Actualizar(ByVal _Obj As ClaseDosCamposObj)

    Public MustOverride Sub Eliminar(ByVal _Obj As ClaseDosCamposObj)
#End Region
    
#Region "Buscar"
    Public MustOverride Function ConfigurarBuscar() As ClaseBaseMethod

    Private _buscarObj As BuscarObj
    Public Property BuscarObj() As BuscarObj
        Get
            Return _buscarObj
        End Get
        Set(ByVal Value As BuscarObj)
            _buscarObj = Value
        End Set
    End Property

    Private _DataObj As ClaseBaseData
    Public Property DataObj() As ClaseBaseData
        Get
            Return _DataObj
        End Get
        Set(ByVal Value As ClaseBaseData)
            _DataObj = Value
        End Set
    End Property

    Public Function Buscar(ByVal _Obj As BuscarObj) As BindingList(Of Object)
        Try
            Return _DataObj.Buscar(_Obj)
        Catch ex As SqlException
            Throw ex
        Catch ex As AccesoDatosException
            Throw New ReglaNegociosMetodosException(My.Resources.ResMensajes.ErrorAlEliminarRol, ex)
        Catch ex As ReglaNegociosObjetosException
            Throw New ReglaNegociosMetodosException(My.Resources.ResMensajes.ErrorAlRegistrarPcNueva, ex)
        Catch ex As Exception
            Throw New ReglaNegociosMetodosException(String.Format(My.Resources.ResMensajes.ErrorDesconocido, ex.Message), ex)
        End Try
    End Function
#End Region

#Region "ConfigurarIdExtrangero"
    Public MustOverride Sub ConfigurarIdExtrangero()

    Private _LblIdExtrangero As String
    Public Property LblIdExtrangero() As String
        Get
            Return _LblIdExtrangero
        End Get
        Set(ByVal value As String)
            _LblIdExtrangero = value
        End Set
    End Property
#End Region

End Class
